#pragma once

#include <glm/glm.hpp>
#include <vector>
#include "engine/ecs/component.h"

namespace kanon
{
    struct Particle2D
    {
        glm::vec2 position;
        glm::vec2 size;
        // TODO: add particle rotation.
        glm::vec2 speed;
        float life;
        float total_life;
    };

    struct ParticleMeshComponent : public Component
    {
    public:
        std::vector<Particle2D> particles;
        ParticleMeshComponent(uint32_t num_particles);

        void Update(float deltaTime);
    };

    class ParticleRenderComponent : public Component
    {
    public:
        glm::vec4 color;
        ParticleRenderComponent(const glm::vec4& color)
        {
            // color = glm::vec4(0.3f, 0.3, 1.0f, 1.0f);
            this->color = color;
        }
    };
}
